<template>
	<view class="fabu-body">
		<view class="video-view">
			<!-- <video class="video-cls" :src="videoUrl" :poster="posterUrl"></video> -->
			<txv-video :vid="videoId"></txv-video>
		</view>
		<view class="tn-padding-sm tn-text-bold ">
			<text>{{title}}</text>
		</view>
		<view class="tn-padding-sm" v-if="kechengjianjie">
			<text class="tn-padding-right-sm">课程简介</text> <text class="zitineirong">{{kechengjianjie}}</text> 
		</view>
		<view class="tn-padding-sm ">
			<view class="tn-margin-bottom-sm">
				<text class="tn-padding-right-sm">时长</text> <text class="zitineirong">{{time}}分钟</text> 
			</view>
			<view class="">
				<text class="tn-padding-right-sm">讲师</text> <text class="zitineirong">{{lecturerName}}</text> 
			</view>
		</view>
		<view class="tn-padding-sm" v-if="jiangshijianjie">
			<text class="tn-padding-right-sm">讲师简介</text> <text class="zitineirong">{{jiangshijianjie}}</text> 
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return {
				videoUrl: 'https://www.w3school.com.cn/example/html5/mov_bbb.mp4',
				posterUrl: '',
				title: '',
				time: 10,
				lecturerName: '',
				jiangshijianjie: '',
				kechengjianjie: '',
				detailInfo: null,
				imageTitle: '',
				videoId: 'p0743x9grjv'
			}
		},
		onShow() {
			
				this.imageTitle = this.config.apiUri + '/sysFileInfo/previewImg?id=';
			let detail = uni.getStorageSync('kechengdetail')
			if(detail){
				this.detailInfo = detail;
				this.title = this.detailInfo.courseName;
				this.time = this.detailInfo.duration;
				this.lecturerName = this.detailInfo.lecturerName;
				this.jiangshijianjie = this.detailInfo.lecturer.description;
				this.kechengjianjie = this.detailInfo.kechengjianjie;
				if(this.detailInfo.coursesource == 0){
					if(this.detailInfo.videosId){
						this.videoUrl = this.imageTitle + this.detailInfo.videosId;
					}
					if(this.detailInfo.imgId){
						this.posterUrl = this.imageTitle + this.detailInfo.imgId;
					}
				}else {
					this.videoUrl = this.detailInfo.coursesourceStr;
				}
			}
		}
	}
</script>

<style  lang="scss" scoped>
	
		.fabu-body{
			position: absolute;
			left: 0;
			right: 0;
			top: 0;
			bottom: 0;
			background-color: rgba(245, 245, 245, 1);
		}
		.video-view{
			width: 100%;
			height: 412rpx;
			background-color: #ffffff;
			margin-bottom: 30rpx;
		}
	.video-cls{
		width: 100%;
		height: 100%;
	}
	.zitineirong{
		color: #555555;
	}
</style>